<template>
  <view class="setting-container">
    <!-- 设置选项列表 -->
    <view class="setting-list">
      <!-- 个人信息 -->
      <view class="setting-item" @tap="navigateTo('/pagesShop/mine/info')">
        <text class="item-text">个人信息</text>
        <text class="gui-icons gui-block gui-text item-arrow">&#xe601;</text>
      </view>

      <!-- 用户注册协议 -->
      <view class="setting-item" @tap="navigateTo('/pagesShop/mine/privacy')">
        <text class="item-text">隐私协议</text>
        <text class="gui-icons gui-block gui-text item-arrow">&#xe601;</text>
      </view>

      <!-- 关于我们 -->
      <view class="setting-item" @tap="navigateTo('/pagesShop/mine/about')">
        <text class="item-text">关于我们</text>
        <text class="gui-icons gui-block gui-text item-arrow">&#xe601;</text>
      </view>
    </view>

    <!-- 退出登录按钮 -->
    <!-- <view class="logout-section">
      <button class="logout-btn" @tap="handleLogout">退出登录</button>
    </view> -->
  </view>
</template>

<script setup>
import { clearToken } from "@/utils/vmeitime-http/localStorage.js";
// 页面导航方法
const navigateTo = (url) => {
  uni.navigateTo({
    url: url,
  });
};

// 退出登录方法
const handleLogout = () => {
  uni.showModal({
    title: "提示",
    content: "确定要退出登录吗？",
    success: (res) => {
      if (res.confirm) {
        clearToken()

        // 跳转到登录页
        uni.reLaunch({
          url: "/pages/login/login",
        });
      }
    },
  });
};
</script>

<style lang="scss" scoped>
.setting-container {
  min-height: 100vh;
  background-color: #f5f5f5;
  display: flex;
  flex-direction: column;
}

.setting-list {
  background-color: #ffffff;
  margin-bottom: 20rpx;
}

.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 50rpx 30rpx;
  border-bottom: 1px solid #f0f0f0;

  &:last-child {
    border-bottom: none;
  }

  .item-text {
    font-size: 30rpx;
    color: #333333;
  }

  .item-arrow {
    font-size: 30rpx;
    color: #cccccc;
  }
}

.logout-section {
  margin-top: 40rpx;
  padding: 0 30rpx;

  .logout-btn {
    background: linear-gradient(135deg,#4a90e2,#67b8f7);
    color: #ffffff;
    height: 90rpx;
    line-height: 90rpx;
    font-size: 32rpx;
    border-radius: 45rpx;
    border: none;
  }
}
</style>
